package org.cheniy.domain.strategy.model.entity;

import lombok.*;
import org.cheniy.domain.strategy.model.valobj.RuleLogicCheckTypeVO;

/**
 * @author cheniy
 * @description 规则过滤返回动作实体
 * @create 2025/3/6 12:17
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class RuleActionEntity <T extends RuleActionEntity.RaffleEntity> {

    private String code= RuleLogicCheckTypeVO.ALLOW.getCode();
    private String info= RuleLogicCheckTypeVO.ALLOW.getInfo();
    private String ruleModel;

    // 对应模版子类中的数据
    private T data;

    // 表示传进来的泛型必须是我定义好的下面几个类
    static public class RaffleEntity{

    }

    @EqualsAndHashCode (callSuper = true)
    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    // 抽奖之前（只考虑黑名单和权重规则）
    static public class RaffleBeforeEntity extends RaffleEntity{
        /** 抽奖策略ID */
        private Long strategyId;
        /** 抽奖奖品ID【规则类型为策略，则不需要奖品ID】 */
        private Integer awardId;
        /** 权值key：用于抽奖时选择权重抽奖 */
        private String ruleWeightValueKey;
    }
    
    // 抽奖中
    static public class RaffleCenterEntity extends RaffleEntity{

    }

    // 抽奖之后
    static public class RaffleAfterEntity extends RaffleEntity{

    }
}
